﻿export const formComponents = [
  {
    type: 'input',
    name: '单行文本',
    icon: 'icon-danhangwenben',
    relatedComponents: [],
    options: {
      width: '100%',
      defaultValue: '',
      required: false,
      clearable: true,
      disabled: false,
      maxLength: null,
      pattern: '',
      events: [],
      placeholder: '请输入',
      showLabel: true,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      // 联动选项
      linkageOption: {
        isLinkage: false,
        linkageEvents: '',
        // 联动方式分为三种，一种是获取后台数据进行结果渲染，一种是进行数值计算，一种是显示和隐藏
        linkageType: 'eventRender',
        expressionArray: [],
        inputDic: [],
        outputDic: [],
        linkageElements: [],
        showExpression: [],
        sourceExpression: []
      }
    }
  },
  {
    type: 'textarea',
    name: '多行文本',
    relatedComponents: [],
    icon: 'icon-duohangwenben',
    options: {
      width: '100%',
      defaultValue: '',
      maxLength: null,
      required: false,
      disabled: false,
      autosize: true,
      clearable: true,
      pattern: '',
      placeholder: '请输入',
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showLabel: true
    }
  },
  {
    type: 'select',
    name: '下拉选择框',
    relatedComponents: [],
    icon: 'icon-xiala',
    options: {
      width: '100%',
      defaultValue: '',
      multiple: false,
      disabled: false,
      clearable: true,
      placeholder: '请选择',
      required: false,
      events: [],
      options: [
        {
          value: null,
          label: null
        }
      ],
      remote: false, // 远程搜索
      filterable: true,
      remoteOptions: [],
      props: {
        value: '请输入',
        label: '请输入'
      },
      remoteFunc: '',
      inputDic: [],
      outputDic: [],
      showLabel: true,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      // 联动选项
      linkageOption: {
        isLinkage: false,
        linkageEvents: '',
        // 联动方式分为两种，一种是获取后台数据进行结果渲染，一种是进行数值计算
        linkageType: 'eventRender',
        expressionArray: [],
        inputDic: [],
        outputDic: [],
        linkageElements: [],
        showExpression: [],
        sourceExpression: []
      }
    }
  },
  {
    type: 'number',
    name: '数字输入框',
    icon: 'icon-shuzi',
    relatedComponents: [],
    options: {
      width: '100%',
      required: false,
      defaultValue: 0,
      min: -Infinity,
      max: Infinity,
      precision: 0,
      step: 1,
      disabled: false,
      controlsPosition: 'right',
      showLabel: true,
      controlsShow: false,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      // 联动选项
      linkageOption: {
        isLinkage: false,
        linkageEvents: '',
        // 联动方式分为两种，一种是获取后台数据进行结果渲染，一种是进行数值计算
        linkageType: 'expressionRender',
        expressionArray: [],
        inputDic: [],
        outputDic: [],
        linkageElements: [],
        showExpression: [],
        sourceExpression: []
      }
    }
  },
  {
    type: 'radio',
    name: '单选框组',
    icon: 'icon-danxuan',
    relatedComponents: [],
    options: {
      inline: false,
      defaultValue: '',
      options: [
        {
          value: null,
          label: null
        }
      ],
      required: false,
      width: '',
      remote: false,
      remoteOptions: [],
      props: {
        value: 'value',
        label: 'label'
      },
      remoteFunc: '',
      inputDic: [],
      outputDic: [],
      disabled: false,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showLabel: true,
      // 联动选项
      linkageOption: {
        isLinkage: false,
        linkageEvents: '',
        // 联动方式分为三种，一种是获取后台数据进行结果渲染，一种是进行数值计算，一种是显示和隐藏
        linkageType: 'showRender',
        expressionArray: [],
        inputDic: [],
        outputDic: [],
        linkageElements: [],
        showExpression: [],
        sourceExpression: []
      }
    }
  },
  {
    type: 'checkbox',
    name: '多选框组',
    icon: 'icon-duoxuan',
    relatedComponents: [],
    options: {
      inline: false,
      defaultValue: [],
      options: [
        {
          value: null,
          label: null
        }
      ],
      required: false,
      width: '',
      remote: false,
      remoteOptions: [],
      props: {
        value: null,
        label: null
      },
      remoteFunc: '',
      inputDic: [],
      outputDic: [],
      showLabel: true,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      disabled: false,
      // 联动选项
      linkageOption: {
        isLinkage: false,
        linkageEvents: '',
        // 联动方式分为三种，一种是获取后台数据进行结果渲染，一种是进行数值计算，一种是显示和隐藏
        linkageType: 'showRender',
        expressionArray: [],
        inputDic: [],
        outputDic: [],
        linkageElements: [],
        showExpression: [],
        sourceExpression: []
      }
    }
  },
  {
    type: 'time',
    name: '时间选择器',
    icon: 'icon-iconset0112',
    relatedComponents: [],
    options: {
      defaultValue: '12:00:00',
      disabled: false,
      editable: true,
      clearable: true,
      placeholder: '请选择',
      startPlaceholder: '',
      endPlaceholder: '',
      isRange: false,
      rangeSeparator: '-',
      format: 'HH:mm:ss',
      required: false,
      events: [],
      width: '100%',
      showLabel: true,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      // 联动选项
      linkageOption: {
        isLinkage: false,
        linkageEvents: '',
        // 联动方式分为两种，一种是获取后台数据进行结果渲染，一种是进行数值计算
        linkageType: 'eventRender',
        expressionArray: [],
        inputDic: [],
        outputDic: [],
        linkageElements: [],
        showExpression: [],
        sourceExpression: []
      }
    }
  },
  {
    type: 'date',
    name: '日期选择器',
    icon: 'icon-riqi',
    relatedComponents: [],
    options: {
      defaultValue: '',
      disabled: false,
      editable: true,
      clearable: true,
      placeholder: '请选择',
      startPlaceholder: '',
      endPlaceholder: '',
      rangeSeparator: '-',
      type: 'date',
      format: 'yyyy-MM-dd',
      required: false,
      events: [],
      width: '100%',
      showLabel: true,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      // 联动选项
      linkageOption: {
        isLinkage: false,
        linkageEvents: '',
        // 联动方式分为两种，一种是获取后台数据进行结果渲染，一种是进行数值计算
        linkageType: 'eventRender',
        expressionArray: [],
        inputDic: [],
        outputDic: [],
        linkageElements: [],
        showExpression: [],
        sourceExpression: []
      }
    }
  },
  {
    type: 'rate',
    name: '评分',
    icon: 'icon-pingfenshoucang-',
    relatedComponents: [],
    options: {
      defaultValue: null,
      max: 5,
      disabled: false,
      allowHalf: false,
      required: false,
      showScore: false,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showLabel: true
    }
  },
  {
    type: 'color',
    name: '颜色选择器',
    icon: 'icon-yanse',
    relatedComponents: [],
    options: {
      defaultValue: '',
      disabled: false,
      showAlpha: false,
      required: false,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showLabel: true
    }
  },
  {
    type: 'switch',
    name: '开关',
    icon: 'icon-38kaiguanguan1',
    relatedComponents: [],
    options: {
      defaultValue: false,
      required: false,
      disabled: false,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showLabel: true,
      // 联动选项
      linkageOption: {
        isLinkage: false,
        linkageEvents: '',
        // 联动方式分为三种，一种是获取后台数据进行结果渲染，一种是进行数值计算，一种是显示和隐藏
        linkageType: 'showRender',
        expressionArray: [],
        inputDic: [],
        outputDic: [],
        linkageElements: [],
        showExpression: [],
        sourceExpression: []
      }
    }
  },
  {
    type: 'slider',
    name: '滑块',
    icon: 'icon-huakuai-',
    relatedComponents: [],
    options: {
      defaultValue: 0,
      disabled: false,
      required: false,
      min: 0,
      max: 100,
      step: 1,
      showInput: false,
      range: false,
      width: '',
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showLabel: true
    }
  },
  {
    type: 'imgupload',
    name: '文件上传',
    icon: 'icon-tupian',
    relatedComponents: [],
    options: {
      disabled: false,
      showLabel: true,
      isHidden: false,
      required: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      limit: 1
    }
  },
  // 输入框--富文本输入框
  {
    type: 'RichText',
    name: '富文本输入框',
    icon: 'icon-fuwenben',
    relatedComponents: [],
    options: {
      required: false,
      disabled: false,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showLabel: true
    }
  },
  // 输入框--MD编辑器
  {
    type: 'MD',
    name: 'MD编辑器',
    icon: 'icon-buju',
    relatedComponents: [],
    options: {
      required: false,
      disabled: false,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showLabel: true
    }
  },
  // 输入框--JSONEditor编辑器
  {
    type: 'JSONEditor',
    name: 'JSON编辑器',
    icon: 'icon-json',
    relatedComponents: [],
    options: {
      required: false,
      disabled: false,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showLabel: true
    }
  },
  {
    type: 'video',
    name: '视频文件',
    icon: 'icon-ai23',
    relatedComponents: [],
    options: {
      defaultValue: null,
      disabled: false,
      required: false,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showLabel: true
    }
  }
  // 输入框--地图经纬度
  // {
  //   type: 'MapXY',
  //   name: '地图经纬度',
  //   relatedComponents: [],
  //   icon: 'icon-ditu',
  //   options: {
  //     required: false,
  //     disabled: false,
  //     isHidden: false,
  //     // 隐藏表达式
  //     hiddenExpress: '',
  //     // 只读表达式
  //     disabledExpress: '',
  //     showLabel: true
  //   }
  // },
  // 输入框--图片位置拾取
  // {
  //   type: 'PicXY',
  //   name: '图片位置拾取',
  //   relatedComponents: [],
  //   icon: 'icon-ditu1',
  //   options: {
  //     required: false,
  //     disabled: false,
  //     isHidden: false,
  //     // 隐藏表达式
  //     hiddenExpress: '',
  //     // 只读表达式
  //     disabledExpress: '',
  //     showLabel: true
  //   }
  // }
]

export const layoutComponents = [
  {
    type: 'grid',
    name: '栅格布局',
    icon: 'icon-buju',
    relatedComponents: [],
    columns: [
      {
        span: 12,
        isButtonGroup: false,
        list: []
      },
      {
        span: 12,
        isButtonGroup: false,
        list: []
      }
    ],
    options: {
      gutter: 10,
      justify: 'start',
      isHidden: false,
      align: 'top'
    }
  },
  {
    type: 'tabs',
    name: 'Tabs 标签页',
    icon: 'icon-bootstrap_tabs',
    relatedComponents: [],
    tabList: [{
      label: 'tab1',
      list: []
    }],
    options: {
      tabType: 'border-card',
      isHidden: false,
      stretch: false
    }
  }
]

export const otherComponents = [
  {
    type: 'table',
    name: '表格',
    icon: 'icon-biaoge',
    relatedComponents: [],
    tableColumn: [
      {
        text: '表头名称',
        indexName: '键名'
      }
    ],
    tableData: [],
    totalData: [],
    filterData: [],
    remote: false,
    remoteColumn: [],
    tableColumnFunc: '',
    props: {
      text: '表头名称',
      indexName: '键名'
    },
    options: {
      isAutoColumnFromData: false,
      stripe: true,
      width: '100%',
      events: [],
      rowEvents: [],
      isHidden: false,
      border: true
    }
  },
  {
    type: 'listBoxTable',
    name: '列表级联表格',
    icon: 'icon-shubiao',
    leftData: [],
    totalData: [],
    curRemoteConfig: '',
    selectedValue: '',
    leftDataOptions: {
      remoteFunc: '',
      inputDic: [],
      outputDic: []
    },
    tableDataOptions: {
      remoteFunc: '',
      inputDic: [],
      outputDic: []
    },
    options: {
      isLoad: false,
      stripe: true,
      width: '100%',
      rowEvents: {},
      isHidden: false,
      border: true,
      valueKey: 'value',
      labelKey: 'label',
      tableHeader: [
        {
          text: '表头名称',
          indexName: '键名'
        }
      ]
    }
  },
  {
    type: 'editTable',
    name: '可编辑表格',
    icon: 'icon-zidingyi',
    tableColumn: [
      {
        text: '表头名称',
        indexName: '键名',
        uiType: 'input',
        // 数据来源
        selectOption: {
          remote: false,
          remoteFunc: '',
          inputDic: [],
          outputDic: [],
          remoteOption: [],
          remoteProps: {
            value: '值的key',
            label: 'label的key'
          },
          staticOption: [
            {
              value: null,
              label: null
            }
          ]
        },
        // 联动选项
        linkageOption: {
          isLinkage: false,
          linkageEvents: '',
          // 联动方式分为两种，一种是获取后台数据进行结果渲染，一种是进行数值计算
          linkageType: 'eventRender',
          expressionArray: [],
          inputDic: [],
          outputDic: [],
          linkageElements: []
        }
      }
    ],
    tableData: [],
    options: {
      stripe: true,
      width: '100%',
      disabled: false,
      border: true,
      showLabel: true,
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      showAdd: true
    }
  },
  // 普通的按钮
  {
    type: 'bottomButton',
    name: '按钮',
    icon: 'icon-anniu',
    relatedComponents: [],
    options: {
      disabled: false,
      events: [],
      textAlign: 'left',
      type: 'primary',
      isHidden: false,
      // 隐藏表达式
      hiddenExpress: '',
      // 只读表达式
      disabledExpress: '',
      dialogInfo: {
        dialogType: '',
        dialogEvent: '',
        dialogUid: ''
      }
    }
  },
  {
    type: 'pagination',
    name: '页码',
    icon: 'icon-list',
    relatedComponents: [],
    options: {
      currentPage: 1,
      pageSize: 10,
      events: [],
      isHidden: false,
      totalLength: 0,
      isSearch: false
    }
  }
]
